package com.sa.spring.web.control;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.sa.spring.service.MsgValidService;


@Controller
public class MsgValidController {
	@Autowired
	MsgValidService msgService;
	
	@RequestMapping("/valid.html")
	public ModelAndView msgValid(@RequestParam("msg")String msg){
		int res = msgService.validMsg(msg);
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("valid", res);
		map.put("msg", msg);
		return new ModelAndView("validShow",map);		
	}
}
